﻿/**
 * @file ComponentFactory.cpp
 * @brief 组件工厂
 * @author YanZhiHui (chanyuantiandao@126.com)
 * @date 2024-04-19
 */
#include "ComponentFactory.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
#include "FITK_Component/FITKCompMessageWidget/FITKConsoleComponent.h"
#include "FITK_Component/FITKRenderWindowVTK/FITKGraph3DWindowInterface.h"
#include "FITK_Component/FITKGeoCompOCC/FITKGeoCompOCCInterface.h"
#include "FITK_Component/FITKVAOneXMLIO/FITKVAOneXMLIOInterface.h"
#include "FITK_Component/FITKNastranBDFIO/FITKNastranBDFIOInterface.h"
#include "FITK_Component/FITKMeshGenGmsh/FITKMeshGenGmshInterface.h"
#include "PreWindowInitializer.h"
#include "OperatorsModel/OpersModelInterface.h"
#include "OperatorsGUI/OpersGUIInterface.h"
#include "FITK_Component/FITKVAOneHDF5IO/FITKVAOneHDF5IOInterface.h"
#include "FITK_Component/FITKAcousticsHDF5IO/FITKAcousticsHDF5IOInterface.h"
#include "FITK_Component/FITKGeoOCCIOHDF5/FITKOCCIOHDF5Interface.h"
#include "FITK_Component/FITKPlotWindow/FITKPlotWindowsInterface.h"

QList<AppFrame::FITKComponentInterface *> ComponentFactory::createComponents()
{
    // 自定义组件列表
    QList<AppFrame::FITKComponentInterface *> componentList;
    // 消息窗口组件
    componentList << new Comp::ConsoleComponent(FITKAPP->getGlobalData()->getMainWindow());
    // 3D图形窗口组件
    auto compVTKrender = new Comp::FITKGraph3DWindowInterface;
    
    // VTK窗口初始化器
    compVTKrender->addInitializer(1, new PreWindowInitializer);

    componentList << compVTKrender;

    //occ 建模
    componentList << new OCC::FITKGeoCompOCCInterface;
    //Gmsh网格划分
    componentList << new Gmsh::FITKMeshGenGmshInterface;
    //VA One XML读写
    componentList << new VAOne::FITKVAOneXMLIOInterface;
    //后处理Hdf5 文件读取
    componentList << new VAOne::FITKVAOneHDF5IOInterface;
    //bdf 文件读取
    componentList << new Nastran::FITKNastranBDFIOInterface;
    //工程文件读写
    componentList << new IO::FITKAcousticsHDF5IOInterface;
    componentList << new IO::FITKOCCIOHDF5Interface;

    //操作器
    componentList << new OperModel::OpersModelInterface;
    componentList << new GUIOper::OperGUIInterface;
    //后处理窗口
    componentList << new Plot::FITKPlotWindowsInterface;

    return componentList;
}
